package com.example.springbootdemo.Controller;

import com.example.springbootdemo.Model.User;
import com.example.springbootdemo.Service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/userList")
    public List<User> getAllUsers() {
        List<User> list = this.userService.getAllUsers();
        return list;
    }
}